<template>
	<view class="content cl">
		<ul class="che-list cl">
			<li @tap="param_to_url('yuyue_details?rowid='+item.rowid)" v-for="(item,index) in data_list" :key="index">
				<image :src="item.cover"></image>
				<div class="right-content cl">
					<p>{{item.sbflmc}}</p>
					<p>月租￥<span>{{item.yzjfje}}</span></p>
				</div>
				<div class="right-span1" style="display: none;">
					{{index+1}}
				</div>
				<div class="right-span2">
					立即租
				</div>
			</li>
		</ul>
	</view>
</template>

<script>
	import common_config from '../../static/js/common.js';
	var config = common_config.config;
	var that;	
	var userInfo;
	export default {
		data() {
			return {
				data_list:[]
			}
		},
		onLoad() {
			that = this;
			that.plusReady();
		},
		methods: {
			//初始化
			plusReady(){
			  	userInfo = uni.getStorageSync('userInfo');
			  	if(userInfo){
			  		userInfo = JSON.parse(userInfo);
			  		that.if_login = true;
			  		that.member_profile = userInfo;
			  	}else{
			  		that.if_login = false;
			  	}
			  	that.load_datas();
			},
			load_datas(){
				console.log(121212);
				uni.request({
				  url: config.request_url+'/v2/open/worksheet/getFilterRows',
				  method: 'POST',
				  header: {
					'Content-Type': 'application/json'
				  },
				  data: {
					"appKey": config.appKey,
					"sign": config.sign,
					"worksheetId": "czsbfl",
					"pageSize":50,
					"pageIndex":1,
					"filters": [
						{
							"controlId": "sfqy",
							"dataType": 11,
							"spliceType": 1,
							"filterType": 2,
							"value": "是"
						}
					]
				  },
				  success: (res) => {
					console.log('返回结果:', res.data);
					res = res.data;
					console.log(res);
					if(res.success){
						that.data_list = res.data.rows;
						for(var i = 0;i < that.data_list.length;i++){
							var r = that.data_list[i].tupian;
							
							r = JSON.parse(r);
							console.log(r);
							that.data_list[i].cover = r[0].original_file_full_path;
						}
					}else{
						 uni.showToast({ title: res.data.msg || '数据获取失败', icon: 'none' });
					}
				  },
				  fail: (err) => {
					console.error('请求失败:', err);
					uni.showToast({ title: '网络错误', icon: 'none' });
				  }
				})  
			},
			param_to_url(url){
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style>
page,.content{background-color: #f6f6f6;}
.che-list li{margin-left: 3%;background-color: #fff;padding: 20rpx 3%;width:88%;border-radius: 16rpx;margin-top: 20rpx;height: auto;overflow: hidden;position: relative;}
.che-list li image{width: 30%;height: 188rpx;}
.right-content{float: right;width: 67%;}
.right-content p:nth-child(1){font-weight: bold;}
.right-content p:nth-child(2){position: absolute;bottom: 20rpx;color: #FF2D2D;font-weight: bold;}
.right-content p:nth-child(2) span{font-size: 34rpx;}
.right-span1{position: absolute;background:linear-gradient(to bottom, #10bff8, #13e8eb);display: block;padding: 0px 20rpx;line-height: 40rpx;color: #fff;right: 0px;top: 0px;border-radius: 0rpx 0px 0px 12rpx;}
.right-span2{bottom: 20rpx;right: 3%;position: absolute;background:linear-gradient(to bottom, #10bff8, #13e8eb);color: #fff;font-size: 28rpx;padding: 4rpx 10rpx;}
</style>
